package net.sangpil.classes.shape
{
	import flash.display.DisplayObject;
	import flash.display.Shape;
	import flash.display.Sprite;
	
	public class BasicShape extends Object
	{
		public function BasicShape()
		{
			super();
		}
		/**
		 * When you make circle.  
		 * @param x position x.
		 * @param y
		 * @param radius
		 * @param color
		 * @param interaction
		 * @return 
		 * 
		 */		
		static public function circle(radius:Number, color:uint, interaction:String = "yes", x:Number = 0, y:Number = 0):DisplayObject
		{
			var dp:DisplayObject;
			
			switch(interaction)
			{
				case "yes":
					var cir:Sprite = new Sprite();
					cir.graphics.beginFill(color);
					cir.graphics.drawCircle(x, y, radius);
					cir.graphics.endFill();
					dp = cir;
				break;
				case "no":
					var cirNone:Shape = new Shape();
					cirNone.graphics.beginFill(color);
					cirNone.graphics.drawCircle(x, y, radius);
					cirNone.graphics.endFill();
					dp = cirNone;
				break;
			}
			return dp;
		}
		
		static public function rect(width:Number, height:Number, color:uint, interaction:String = "yes", x:Number = 0, y:Number = 0):DisplayObject
		{
			var dp:DisplayObject;
			
			switch(interaction)
			{
				case "yes":
					var rec:Sprite = new Sprite();
					rec.graphics.beginFill(color);
					rec.graphics.drawRect(x, y, width, height);
					rec.graphics.endFill();
					dp = rec;
				break;
				case "no":
					var recNone:Shape = new Shape();
					recNone.graphics.beginFill(color);
					recNone.graphics.drawRect(x, y, width, height);
					recNone.graphics.endFill();
					dp = recNone;
				break;
			}
			return dp;
		} 
	}
}